<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        div{
            height: 200px;
            width: 200px;
            background-color: red;
        }
    </style>
</head>
<body>
  <div class="d1"></div>  
  <script>
    var div = document.getElementsByClassName('d1')[0]
    //click 鼠标左键单击事件
     div.addEventListener('click',function(){
        console.log('鼠标被单击了')
     })
     div.addEventListener('dblclick', function(){
        console.log('鼠标被双击了')
     })
     
     //qwer
     div.addEventListener('mousedom',function(){
        console.log('鼠标被按下了')
     })
     div.addEventListener('mouseup',function(){
        console.log('鼠标被抬起了')
     })
  
  </script>

</body>
</html>